home *** CD-ROM | disk | FTP | other *** search
/ CSi Master: Ableton Live 5 / CSi Master: Ableton Live 5.iso / pc / rsrc / locrsrc / mtprsrc.dir / Internal_13_MapMenuSetup.ls < prev    next >
Encoding:
Text File  |  2005-10-31  |  1.0 KB  |  37 lines

  1. on MapMenuSetup
  2.   mapList = EMPTY
  3.   newLine = 1
  4.   repeat with n = 1 to 200
  5.     case the machineType of
  6.       256:
  7.         mapName = getNthFileNameInFolder(the pathname & "..\MTdata\", n)
  8.       otherwise:
  9.         mapName = getNthFileNameInFolder(the pathname & ":MTdata:", n)
  10.     end case
  11.     if mapName = EMPTY then
  12.       exit repeat
  13.     end if
  14.     case the machineType of
  15.       256:
  16.         mapFilename = the pathname & "..\MTdata\" & mapName
  17.       otherwise:
  18.         mapFilename = the pathname & ":MTdata:" & mapName
  19.     end case
  20.     test = getNthFileNameInFolder(mapFilename, 1)
  21.     if test = EMPTY then
  22.       mapFile = new(xtra("fileIO"))
  23.       openFile(mapFile, mapFilename, 1)
  24.       if status(mapFile) = 0 then
  25.         fileType = getFinderInfo(mapFile)
  26.         if (fileType contains "MMAP") or (mapName contains ".mtg") then
  27.           put mapName into line newLine of mapList
  28.           newLine = newLine + 1
  29.         end if
  30.         closeFile(mapFile)
  31.       end if
  32.       mapFile = 0
  33.     end if
  34.   end repeat
  35.   return mapList
  36. end
  37.